package com.cskaoyan;

import redis.clients.jedis.Jedis;

import java.util.HashMap;

/**
 * 创建日期: 2022/07/11 17:19
 *
 * @author ciggar
 */
public class JedisDemo {

    public static void main(String[] args) {

        // 新建一个Jedis客户端
        Jedis jedis = new Jedis("localhost",6379);

        // 设置密码
        jedis.auth("cskaoyan");


        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("name","zhangsan");
        hashMap.put("age","20");
        hashMap.put("height","180");
        hashMap.put("nickname","小三");
        // 操作
        jedis.hmset("user",hashMap);


    }
}
